<link	rel="stylesheet" type="text/css" href="/meditravel/script/multiselect/css/common.css" media="all">
<link	rel="stylesheet" type="text/css" href="/meditravel/script/multiselect/css/ui.multiselect.css" media="all">
<?php if(isset($cities)){ ?>
	<?php echo form_open('edit/organisation/addTravel'); ?>
	<table>
		<tr>
			<td>
				<h2>Communes de départ</h2>
				<select id="citiesFrom" class="multiselect" multiple="multiple" name="citiesFrom[]">
					<?php foreach ($cities as $city){ ?>
						<option value="<?php echo $city->zip;?>" <?php echo ($city->zip==$city->fromSelected?"selected":""); ?>><?php echo $city->name;?></option>
					<?php }?>
				</select>
				<br>
				<h2>Communes d'arrivée</h2>
				<select id="citiesTo" class="multiselect" multiple="multiple" name="citiesTo[]">
					<?php foreach ($cities as $city){ ?>
						<option value="<?php echo $city->zip;?>" <?php echo ($city->zip==$city->toSelected?"selected":""); ?>><?php echo $city->name;?></option>
					<?php }?>
				</select>
				<input type="hidden" name="orgId" value="<?php echo $organisation->id;?>"> 
			</td>
			<td valign="top" style="padding-left: 5px;">
				<input type="submit" value="Enregistrer"/>
			</td>
		</tr>
	</table>
	</form>
	<script>
		$(document).ready(
				function() {
					 // choose either the full version
					  $(".multiselect").multiselect();
					  // or disable some features
					  $(".multiselect").multiselect({sortable: false, searchable: false});
				}
			);
	</script>
	
<?php } ?>
